(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.payCode.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'payCodeService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, payCodeService) {
		var ctrl = this, params = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;

		ctrl.init = function() {	
			ctrl.payCode = {};
			payCodeService.initDropDownDataOptions($scope, ctrl).then(function() {
				return authService.view(params).then(function(response) {
					ctrl.payCode = response.data || payCodeInfo;
					payCodeService.initGeneral($scope, ctrl);
				}, angular.noop);
			});
		};
	}
})(angular);